<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<form enctype="multipart/form-data" id="uploadForm">
  <input type='file' name='xxx' id='pic_img'>
  <input type='button' onclick='upload()' value='点击上传'>
</form>
</body>
</html>
<script>

  function upload(){
    // var formData = new FormData($("#uploadForm")[0])  //创建一个forData
    // console.log( $('#pic_img')[0].files[0])
    // formData.append('file', $('#pic_img')[0].files[0]) //把file添加进去  name命名为img
    $.ajax({
      url:"http://localhost:8080/oo",
      data: data,
      type: "get",
      async: false,
      cache: false,
      contentType: false,
      processData: false,
      success: function(data) {
      //成功
    },
    error: function() {
      //失败
    }
  })
  }

</script>
